package cn.wolfcode.luowowo.article.domain;

import cn.wolfcode.luowowo.common.domain.BaseDomain;
import lombok.*;
import org.springframework.util.StringUtils;

import java.util.List;

/**
 * 月份推荐
 */
@Setter
@Getter
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MonthCommend extends BaseDomain {
    private Long id;
    private String destIds; //目的id
    private Long month; //月份
    private List<Destination> dests;//目的地
    public Long[] getDestIds(){
        Long[] arr =null;
        if(StringUtils.hasLength(destIds)){
            String[] ids = destIds.split(",");
            arr=new Long[ids.length];
            for (int i = 0;i<ids.length;i++){
                arr[i] = Long.parseLong(ids[i]);
            }
        }
        return arr;
    }
}
